package vip.xiaozhao.paotui.intf.mapper;

import org.apache.ibatis.annotations.*;
import vip.xiaozhao.paotui.intf.entity.PaotuiWalletWithdraw;

@Mapper
public interface PaotuiWalletWithdrawMapper {

    @Select("select * from xzvip_paotui_wallet_withdraw where id=#{id}")
    PaotuiWalletWithdraw loadById(int id);

    @Insert("insert into xzvip_paotui_wallet_withdraw(UserId,ChannelId,Amount,Status,AddTime,UpdateTime)" +
            "values (#{userId},#{channelId},#{amount},#{status},now(),now())")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    int insert(PaotuiWalletWithdraw walletWithdraw);

    @Update("update xzvip_paotui_wallet_withdraw set UserId = #{userId},ChannelId = #{channelId}," +
            "Amount = #{amount},Status = #{status} , UpdateTime = now() where id = #{id} ")
    int update(PaotuiWalletWithdraw walletWithdraw);
}
